<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<div id="header">
    <h2 id="title">/p91/</h2>

    <c:if test="${empty sessionScope.user}">
        <div id="loginForm">
            <form action="${contextPath}login/" method="POST">
                <label for="login">Логин:</label>
                <input id="login" name="login" type="text" /> <br />
                <label for="password">Пароль:</label>
                <input id="password" name="password" type="password" /> <br />
                <input type="submit" value="Вход"/>
                <span id="errorMsg"><c:out value="${error}"/></span>
            </form>
            <a href="${contextPath}registration.html">Регистрация</a>
        </div>
    </c:if>

    <c:if test="${not empty sessionScope.user}">
        <div id="userHeadInfo">
            Вы вошли как: <c:out value="${sessionScope.user.login}"/> <br/>
            <a href="${contextPath}logout/">[Выйти]</a>
        </div>
    </c:if>

</div>